package ${package.ServiceImpl};

import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.mybatisplus.common.model.param.ParamBean;
import com.mybatisplus.common.model.result.ResultBean;
import com.mybatisplus.common.page.PageInfo;
import com.mybatisplus.common.page.PageVo;
import org.springframework.beans.factory.annotation.Autowired;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import ${package.Entity}.${entity};
import ${package.Mapper}.${table.mapperName};
import ${package.Service}.${table.serviceName};
import ${superServiceImplClassPackage};
import org.springframework.stereotype.Service;

/**
 * <p>
 * ${table.comment!} 服务实现类
 * </p>
 *
 * @author ${author}
 * @since ${date}
 */
@Service
<#if kotlin>
open class ${table.serviceImplName} : ${superServiceImplClass}<${table.mapperName}, ${entity}>(), ${table.serviceName} {

}
<#else>
public class ${table.serviceImplName} extends ${superServiceImplClass}<${table.mapperName}, ${entity}> implements ${table.serviceName} {

    private final Logger logger = LoggerFactory.getLogger(${table.serviceImplName}.class);

    @Autowired
    private ${table.mapperName} ${table.name}Mapper;

    @Override
    public ResultBean<PageVo> pageList(ParamBean<${table.entityName}> paramBean){

        PageVo<${table.entityName}> pageVo = new PageVo<>();
        PageInfo pageInfo = new PageInfo();
        Page<${table.entityName}> page = new Page<>(paramBean.getPageNum(), paramBean.getPageSize());
        ${table.name}Mapper.selectPage(page,null);
        pageVo.setDatas(page.getRecords());
        pageInfo.setTotalPageNum(Integer.valueOf(page.getTotal()+""));
        pageVo.setPageInfo(pageInfo);
        return ResultBean.createSuccess(pageVo);
    }
}
</#if>